{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 拉勾网爬取流程代码及数据加值阐述\n",
    "- ## 由于gitee限制，图表无法加载，内容以右边的链接为准，请点击观看完整内容，感谢！[网页链接](http://bakasui.gitee.io/wajue_final/) "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 搭建基础框架，爬取广州市包含文案关键词所有职位信息"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import requests\n",
    "import time# 加载所需模块\n",
    "\n",
    "def headers_to_dict(headers):\n",
    "    headers = headers.split(\"\\n\")\n",
    "    d_headers = dict()\n",
    "    for h in headers:\n",
    "        if h:\n",
    "            k, v = h.split(\":\", 1)\n",
    "            if k == 'cookie' and d_headers.get(k, None) is not None:\n",
    "                d_headers[k] = d_headers.get(k) + \"; \" + v.strip()\n",
    "            else:\n",
    "                d_headers[k] = v.strip()\n",
    "    return d_headers"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 200,
   "metadata": {},
   "outputs": [],
   "source": [
    "import urllib3 # 此模块用于解决警告弹出问题\n",
    "\n",
    "urllib3.disable_warnings()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 95,
   "metadata": {},
   "outputs": [],
   "source": [
    "home_url = 'https://www.lagou.com/jobs/list_%E6%96%87%E6%A1%88?city=%E5%B9%BF%E5%B7%9E'# 需要爬取的url\n",
    "url = 'https://www.lagou.com/jobs/positionAjax.json?px=new&needAddtionalResult=false'\n",
    "headers = \"\"\"\n",
    "accept: application/json, text/javascript, */*; q=0.01\n",
    "origin: https://www.lagou.com\n",
    "referer: https://www.lagou.com/jobs/list_%E6%96%87%E6%A1%88?city=%E5%B9%BF%E5%B7%9E\n",
    "user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36\n",
    "\"\"\" # 使用网站的headers信息 伪装成客户端来爬取数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "metadata": {},
   "outputs": [],
   "source": [
    "headers_dict = headers_to_dict(headers)\n",
    "\n",
    "\n",
    "def get_data_from_cloud(page):# 设置爬取参数\n",
    "    params = {\n",
    "        'first': 'false',\n",
    "        'pn': page,\n",
    "        'kd': '文案'\n",
    "    }\n",
    "    s = requests.Session()  # 创建一个session对象\n",
    "    s.get(home_url, headers=headers_dict, timeout=5)  # 用session对象发出get请求，请求首页获取cookies\n",
    "    cookie = s.cookies  # 为此次获取的cookies\n",
    "    response = requests.post(url, data=params, headers=headers_dict, cookies=cookie, timeout=3,verify= False)\n",
    "    result = response.text\n",
    "    write_file(result)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 97,
   "metadata": {},
   "outputs": [],
   "source": [
    "def write_file(content):\n",
    "    filename = '文案.txt'# 设置输出文件的名称和格式\n",
    "    with open(filename, 'a',encoding='utf-8') as f:\n",
    "        f.write(content + '\\n')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 99,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_data():\n",
    "    for i in range(76):# 所爬取的数据页数，分行业部分根据各行业筛选结果实际页面数调整\n",
    "        page = i + 1\n",
    "        get_data_from_cloud(page)\n",
    "        time.sleep(10)# 设置爬取间隔时间，根据爬取量的不同调整\n",
    "\n",
    "\n",
    "get_data()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 分行业爬取数据\n",
    "\n",
    "- **图上红圈部分为我划分的传统文案相关行业**\n",
    "![传统行业](https://gitee.com/bakasui/wajue_final/raw/master/%E4%BC%A0%E7%BB%9F%E8%A1%8C%E4%B8%9A.png)\n",
    "\n",
    "- **图上蓝圈部分为我划分的网新相关行业**\n",
    "![网新行业](https://gitee.com/bakasui/wajue_final/raw/master/%E7%BD%91%E6%96%B0%E7%9B%B8%E5%85%B3%E8%A1%8C%E4%B8%9A.png)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 爬取移动互联网分类下的数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 143,
   "metadata": {},
   "outputs": [],
   "source": [
    "home_url = 'https://www.lagou.com/jobs/list_%E6%96%87%E6%A1%88/p-city_213?hy=%E7%A7%BB%E5%8A%A8%E4%BA%92%E8%81%94%E7%BD%91'\n",
    "url = 'https://www.lagou.com/jobs/positionAjax.json?px=new&needAddtionalResult=false'\n",
    "headers = \"\"\"\n",
    "accept: application/json, text/javascript, */*; q=0.01\n",
    "origin: https://www.lagou.com\n",
    "referer: https://www.lagou.com/jobs/list_%E6%96%87%E6%A1%88/p-city_213?hy=%E7%A7%BB%E5%8A%A8%E4%BA%92%E8%81%94%E7%BD%91\n",
    "user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36\n",
    "\"\"\"\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 144,
   "metadata": {},
   "outputs": [],
   "source": [
    "headers_dict = headers_to_dict(headers)\n",
    "\n",
    "\n",
    "def get_data_from_cloud(page):\n",
    "    params = {\n",
    "        'first': 'false',\n",
    "        'pn': page,\n",
    "        'kd': '文案'\n",
    "    }\n",
    "    s = requests.Session()  # 创建一个session对象\n",
    "    s.get(home_url, headers=headers_dict, timeout=5)  # 用session对象发出get请求，请求首页获取cookies\n",
    "    cookie = s.cookies  # 为此次获取的cookies\n",
    "    response = requests.post(url, data=params, headers=headers_dict, cookies=cookie, timeout=3,verify= False)\n",
    "    result = response.text\n",
    "    write_file(result)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 145,
   "metadata": {},
   "outputs": [],
   "source": [
    "def write_file(content):\n",
    "    filename = '移动互联网分类.txt'\n",
    "    with open(filename, 'a',encoding='utf-8') as f:\n",
    "        f.write(content + '\\n')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 146,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_data():\n",
    "    for i in range(11):\n",
    "        page = i + 1\n",
    "        get_data_from_cloud(page)\n",
    "        time.sleep(8)\n",
    "\n",
    "\n",
    "get_data()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 爬取文娱内容分类下的数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 149,
   "metadata": {},
   "outputs": [],
   "source": [
    "home_url = 'https://www.lagou.com/jobs/list_%E6%96%87%E6%A1%88/p-city_213?hy=%E6%96%87%E5%A8%B1%E4%B8%A8%E5%86%85%E5%AE%B9'\n",
    "url = 'https://www.lagou.com/jobs/positionAjax.json?px=new&needAddtionalResult=false'\n",
    "headers = \"\"\"\n",
    "accept: application/json, text/javascript, */*; q=0.01\n",
    "origin: https://www.lagou.com\n",
    "referer: https://www.lagou.com/jobs/list_%E6%96%87%E6%A1%88/p-city_213?hy=%E6%96%87%E5%A8%B1%E4%B8%A8%E5%86%85%E5%AE%B9\n",
    "user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36\n",
    "\"\"\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 150,
   "metadata": {},
   "outputs": [],
   "source": [
    "headers_dict = headers_to_dict(headers)\n",
    "\n",
    "\n",
    "def get_data_from_cloud(page):\n",
    "    params = {\n",
    "        'first': 'false',\n",
    "        'pn': page,\n",
    "        'kd': '文案'\n",
    "    }\n",
    "    s = requests.Session()  # 创建一个session对象\n",
    "    s.get(home_url, headers=headers_dict, timeout=5)  # 用session对象发出get请求，请求首页获取cookies\n",
    "    cookie = s.cookies  # 获取的cookies\n",
    "    response = requests.post(url, data=params, headers=headers_dict, cookies=cookie, timeout=3,verify= False)\n",
    "    result = response.text\n",
    "    write_file(result)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 151,
   "metadata": {},
   "outputs": [],
   "source": [
    "def write_file(content):\n",
    "    filename = '文娱内容分类.txt'\n",
    "    with open(filename, 'a',encoding='utf-8') as f:\n",
    "        f.write(content + '\\n')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 152,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_data():\n",
    "    for i in range(17):\n",
    "        page = i + 1\n",
    "        get_data_from_cloud(page)\n",
    "        time.sleep(8)\n",
    "\n",
    "\n",
    "get_data()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 爬取广告营销分类下的数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 183,
   "metadata": {},
   "outputs": [],
   "source": [
    "home_url = 'https://www.lagou.com/jobs/list_%E6%96%87%E6%A1%88/p-city_213?hy=%E5%B9%BF%E5%91%8A%E8%90%A5%E9%94%80'\n",
    "url = 'https://www.lagou.com/jobs/positionAjax.json?px=new&needAddtionalResult=false'\n",
    "headers = \"\"\"\n",
    "accept: application/json, text/javascript, */*; q=0.01\n",
    "origin: https://www.lagou.com\n",
    "referer: https://www.lagou.com/jobs/list_%E6%96%87%E6%A1%88/p-city_213?hy=%E5%B9%BF%E5%91%8A%E8%90%A5%E9%94%80\n",
    "user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36\n",
    "\"\"\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 160,
   "metadata": {},
   "outputs": [],
   "source": [
    "headers_dict = headers_to_dict(headers)\n",
    "\n",
    "\n",
    "def get_data_from_cloud(page):\n",
    "    params = {\n",
    "        'first': 'false',\n",
    "        'pn': page,\n",
    "        'kd': '文案'\n",
    "    }\n",
    "    s = requests.Session()  # 创建一个session对象\n",
    "    s.get(home_url, headers=headers_dict, timeout=5)  # 用session对象发出get请求，请求首页获取cookies\n",
    "    cookie = s.cookies  # 为此次获取的cookies\n",
    "    response = requests.post(url, data=params, headers=headers_dict, cookies=cookie, timeout=3,verify= False)\n",
    "    result = response.text\n",
    "    write_file(result)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 185,
   "metadata": {},
   "outputs": [],
   "source": [
    "def write_file(content):\n",
    "    filename = '广告营销分类.txt'\n",
    "    with open(filename, 'a',encoding='utf-8') as f:\n",
    "        f.write(content + '\\n')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 186,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_data():\n",
    "    for i in range(7):\n",
    "        page = i + 1\n",
    "        get_data_from_cloud(page)\n",
    "        time.sleep(8)\n",
    "\n",
    "\n",
    "get_data()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 爬取电商分类下的数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 201,
   "metadata": {},
   "outputs": [],
   "source": [
    "home_url = 'https://www.lagou.com/jobs/list_%E6%96%87%E6%A1%88/p-city_213?hy=%E7%94%B5%E5%95%86'\n",
    "url = 'https://www.lagou.com/jobs/positionAjax.json?px=new&needAddtionalResult=false'\n",
    "headers = \"\"\"\n",
    "accept: application/json, text/javascript, */*; q=0.01\n",
    "origin: https://www.lagou.com\n",
    "referer: https://www.lagou.com/jobs/list_%E6%96%87%E6%A1%88/p-city_213?hy=%E7%94%B5%E5%95%86\n",
    "user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36\n",
    "\"\"\"\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 172,
   "metadata": {},
   "outputs": [],
   "source": [
    "headers_dict = headers_to_dict(headers)\n",
    "\n",
    "\n",
    "def get_data_from_cloud(page):\n",
    "    params = {\n",
    "        'first': 'false',\n",
    "        'pn': page,\n",
    "        'kd': '文案'\n",
    "    }\n",
    "    s = requests.Session()  # 创建一个session对象\n",
    "    s.get(home_url, headers=headers_dict, timeout=5)  # 用session对象发出get请求，请求首页获取cookies\n",
    "    cookie = s.cookies  # 为此次获取的cookies\n",
    "    response = requests.post(url, data=params, headers=headers_dict, cookies=cookie, timeout=3,verify= False)\n",
    "    result = response.text\n",
    "    write_file(result)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 203,
   "metadata": {},
   "outputs": [],
   "source": [
    "def write_file(content):\n",
    "    filename = '电商分类.txt'\n",
    "    with open(filename, 'a',encoding='utf-8') as f:\n",
    "        f.write(content + '\\n')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 204,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_data():\n",
    "    for i in range(10):\n",
    "        page = i + 1\n",
    "        get_data_from_cloud(page)\n",
    "        time.sleep(8)\n",
    "\n",
    "\n",
    "get_data()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 爬取数据服务分类下的数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 171,
   "metadata": {},
   "outputs": [],
   "source": [
    "home_url = 'https://www.lagou.com/jobs/list_%E6%96%87%E6%A1%88/p-city_213?hy=%E6%95%B0%E6%8D%AE%E6%9C%8D%E5%8A%A1'\n",
    "url = 'https://www.lagou.com/jobs/positionAjax.json?px=new&needAddtionalResult=false'\n",
    "headers = \"\"\"\n",
    "accept: application/json, text/javascript, */*; q=0.01\n",
    "origin: https://www.lagou.com\n",
    "referer: https://www.lagou.com/jobs/list_%E6%96%87%E6%A1%88/p-city_213?hy=%E6%95%B0%E6%8D%AE%E6%9C%8D%E5%8A%A1\n",
    "user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36\n",
    "\"\"\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 184,
   "metadata": {},
   "outputs": [],
   "source": [
    "headers_dict = headers_to_dict(headers)\n",
    "\n",
    "\n",
    "def get_data_from_cloud(page):\n",
    "    params = {\n",
    "        'first': 'false',\n",
    "        'pn': page,\n",
    "        'kd': '文案'\n",
    "    }\n",
    "    s = requests.Session()  # 创建一个session对象\n",
    "    s.get(home_url, headers=headers_dict, timeout=5)  # 用session对象发出get请求，请求首页获取cookies\n",
    "    cookie = s.cookies  # 为此次获取的cookies\n",
    "    response = requests.post(url, data=params, headers=headers_dict, cookies=cookie, timeout=3,verify= False)\n",
    "    result = response.text\n",
    "    write_file(result)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 173,
   "metadata": {},
   "outputs": [],
   "source": [
    "def write_file(content):\n",
    "    filename = '数据服务分类.txt'\n",
    "    with open(filename, 'a',encoding='utf-8') as f:\n",
    "        f.write(content + '\\n')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 174,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_data():\n",
    "    for i in range(6):\n",
    "        page = i + 1\n",
    "        get_data_from_cloud(page)\n",
    "        time.sleep(8)\n",
    "\n",
    "\n",
    "get_data()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 爬取人工智能分类下的数据 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 189,
   "metadata": {},
   "outputs": [],
   "source": [
    "home_url = 'https://www.lagou.com/jobs/list_%E6%96%87%E6%A1%88/p-city_213?hy=%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD'\n",
    "url = 'https://www.lagou.com/jobs/positionAjax.json?px=new&needAddtionalResult=false'\n",
    "headers = \"\"\"\n",
    "accept: application/json, text/javascript, */*; q=0.01\n",
    "origin: https://www.lagou.com\n",
    "referer: https://www.lagou.com/jobs/list_%E6%96%87%E6%A1%88/p-city_213?hy=%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD\n",
    "user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36\n",
    "\"\"\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 190,
   "metadata": {},
   "outputs": [],
   "source": [
    "headers_dict = headers_to_dict(headers)\n",
    "\n",
    "\n",
    "def get_data_from_cloud(page):\n",
    "    params = {\n",
    "        'first': 'false',\n",
    "        'pn': page,\n",
    "        'kd': '文案'\n",
    "    }\n",
    "    s = requests.Session()  # 创建一个session对象\n",
    "    s.get(home_url, headers=headers_dict, timeout=5)  # 用session对象发出get请求，请求首页获取cookies\n",
    "    cookie = s.cookies  # 为此次获取的cookies\n",
    "    response = requests.post(url, data=params, headers=headers_dict, cookies=cookie, timeout=3,verify= False)\n",
    "    result = response.text\n",
    "    write_file(result)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 191,
   "metadata": {},
   "outputs": [],
   "source": [
    "def write_file(content):\n",
    "    filename = '人工智能分类.txt'\n",
    "    with open(filename, 'a',encoding='utf-8') as f:\n",
    "        f.write(content + '\\n')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 192,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_data():\n",
    "    for i in range(1):\n",
    "        page = i + 1\n",
    "        get_data_from_cloud(page)\n",
    "        time.sleep(8)\n",
    "\n",
    "\n",
    "get_data()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 爬取软件开发分类下的数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 195,
   "metadata": {},
   "outputs": [],
   "source": [
    "home_url = 'https://www.lagou.com/jobs/list_%E6%96%87%E6%A1%88/p-city_213?hy=%E8%BD%AF%E4%BB%B6%E5%BC%80%E5%8F%91'\n",
    "url = 'https://www.lagou.com/jobs/positionAjax.json?px=new&needAddtionalResult=false'\n",
    "headers = \"\"\"\n",
    "accept: application/json, text/javascript, */*; q=0.01\n",
    "origin: https://www.lagou.com\n",
    "referer: https://www.lagou.com/jobs/list_%E6%96%87%E6%A1%88/p-city_213?hy=%E8%BD%AF%E4%BB%B6%E5%BC%80%E5%8F%91\n",
    "user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36\n",
    "\"\"\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 196,
   "metadata": {},
   "outputs": [],
   "source": [
    "headers_dict = headers_to_dict(headers)\n",
    "\n",
    "\n",
    "def get_data_from_cloud(page):\n",
    "    params = {\n",
    "        'first': 'false',\n",
    "        'pn': page,\n",
    "        'kd': '文案'\n",
    "    }\n",
    "    s = requests.Session()  # 创建一个session对象\n",
    "    s.get(home_url, headers=headers_dict, timeout=5)  # 用session对象发出get请求，请求首页获取cookies\n",
    "    cookie = s.cookies  # 为此次获取的cookies\n",
    "    response = requests.post(url, data=params, headers=headers_dict, cookies=cookie, timeout=3,verify= False)\n",
    "    result = response.text\n",
    "    write_file(result)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 197,
   "metadata": {},
   "outputs": [],
   "source": [
    "def write_file(content):\n",
    "    filename = '软件开发分类.txt'\n",
    "    with open(filename, 'a',encoding='utf-8') as f:\n",
    "        f.write(content + '\\n')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 198,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_data():\n",
    "    for i in range(4):\n",
    "        page = i + 1\n",
    "        get_data_from_cloud(page)\n",
    "        time.sleep(8)\n",
    "\n",
    "\n",
    "get_data()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 爬取企业服务分类下的数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 159,
   "metadata": {},
   "outputs": [],
   "source": [
    "home_url = 'https://www.lagou.com/jobs/list_%E6%96%87%E6%A1%88/p-city_213?hy=%E4%BC%81%E4%B8%9A%E6%9C%8D%E5%8A%A1'\n",
    "url = 'https://www.lagou.com/jobs/positionAjax.json?px=new&needAddtionalResult=false'\n",
    "headers = \"\"\"\n",
    "accept: application/json, text/javascript, */*; q=0.01\n",
    "origin: https://www.lagou.com\n",
    "referer: https://www.lagou.com/jobs/list_%E6%96%87%E6%A1%88/p-city_213?hy=%E4%BC%81%E4%B8%9A%E6%9C%8D%E5%8A%A1\n",
    "user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36\n",
    "\"\"\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 202,
   "metadata": {},
   "outputs": [],
   "source": [
    "headers_dict = headers_to_dict(headers)\n",
    "\n",
    "\n",
    "def get_data_from_cloud(page):\n",
    "    params = {\n",
    "        'first': 'false',\n",
    "        'pn': page,\n",
    "        'kd': '文案'\n",
    "    }\n",
    "    s = requests.Session()  # 创建一个session对象\n",
    "    s.get(home_url, headers=headers_dict, timeout=5)  # 用session对象发出get请求，请求首页获取cookies\n",
    "    cookie = s.cookies  # 为此次获取的cookies\n",
    "    response = requests.post(url, data=params, headers=headers_dict, cookies=cookie, timeout=3,verify= False)\n",
    "    result = response.text\n",
    "    write_file(result)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 161,
   "metadata": {},
   "outputs": [],
   "source": [
    "def write_file(content):\n",
    "    filename = '企业服务分类.txt'\n",
    "    with open(filename, 'a',encoding='utf-8') as f:\n",
    "        f.write(content + '\\n')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 162,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_data():\n",
    "    for i in range(14):\n",
    "        page = i + 1\n",
    "        get_data_from_cloud(page)\n",
    "        time.sleep(8)\n",
    "\n",
    "\n",
    "get_data()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 用图表深入分析爬取的数据 "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 1.对整体数据进行分析"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "import numpy as np # 载入所需模块\n",
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Bar\n",
    "from pyecharts.charts import Pie\n",
    "from wordcloud import WordCloud\n",
    "import matplotlib.pyplot as plt\n",
    "import json\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_data():\n",
    "    with open('文案.txt',encoding='utf-8') as f:# 打开之前导出的数据文件\n",
    "        data = []\n",
    "        for line in f.readlines():\n",
    "            result = json.loads(line)\n",
    "            result_list = result['content']['positionResult']['result']\n",
    "            for item in result_list:# 构建字典\n",
    "                dict = {\n",
    "                   'district': item['district'],\n",
    "                    'industryField': item['industryField'],\n",
    "                    'education': item['education'],\n",
    "                    'workYear': item['workYear'],\n",
    "                    'salary': item['salary'],\n",
    "                    'firstType': item['firstType'],\n",
    "                    'secondType': item['secondType'],\n",
    "                    'thirdType': item['thirdType'],\n",
    "                    'skillLables': item['skillLables']\n",
    "                }\n",
    "                data.append(dict)\n",
    "        return data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>district</th>\n",
       "      <th>industryField</th>\n",
       "      <th>education</th>\n",
       "      <th>workYear</th>\n",
       "      <th>salary</th>\n",
       "      <th>firstType</th>\n",
       "      <th>secondType</th>\n",
       "      <th>thirdType</th>\n",
       "      <th>skillLables</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>海淀区</td>\n",
       "      <td>移动互联网</td>\n",
       "      <td>本科</td>\n",
       "      <td>1-3年</td>\n",
       "      <td>8k-15k</td>\n",
       "      <td>运营|编辑|客服类</td>\n",
       "      <td>编辑</td>\n",
       "      <td>文案策划</td>\n",
       "      <td>[文案]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>浦东新区</td>\n",
       "      <td>广告营销</td>\n",
       "      <td>本科</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>10k-16k</td>\n",
       "      <td>运营|编辑|客服类</td>\n",
       "      <td>编辑</td>\n",
       "      <td>文案策划</td>\n",
       "      <td>[文案, 策划]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>锦江区</td>\n",
       "      <td>企业服务</td>\n",
       "      <td>本科</td>\n",
       "      <td>不限</td>\n",
       "      <td>8k-15k</td>\n",
       "      <td>运营|编辑|客服类</td>\n",
       "      <td>运营</td>\n",
       "      <td>其他运营</td>\n",
       "      <td>[新媒体运营, 网络运营]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>南山区</td>\n",
       "      <td>移动互联网</td>\n",
       "      <td>本科</td>\n",
       "      <td>1-3年</td>\n",
       "      <td>8k-16k</td>\n",
       "      <td>运营|编辑|客服类</td>\n",
       "      <td>编辑</td>\n",
       "      <td>文案策划</td>\n",
       "      <td>[策划, 文案]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>朝阳区</td>\n",
       "      <td>文娱丨内容</td>\n",
       "      <td>大专</td>\n",
       "      <td>1-3年</td>\n",
       "      <td>6k-12k</td>\n",
       "      <td>运营|编辑|客服类</td>\n",
       "      <td>编辑</td>\n",
       "      <td>文案策划</td>\n",
       "      <td>[文案, 策划, 软文]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>495</th>\n",
       "      <td>南沙区</td>\n",
       "      <td>汽车丨出行</td>\n",
       "      <td>本科</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>15k-20k</td>\n",
       "      <td>运营|编辑|客服类</td>\n",
       "      <td>运营</td>\n",
       "      <td>内容运营</td>\n",
       "      <td>[运营, PGC, 策略运营, 用户增长]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>496</th>\n",
       "      <td>鼓楼区</td>\n",
       "      <td>软件开发、企业服务</td>\n",
       "      <td>不限</td>\n",
       "      <td>1-3年</td>\n",
       "      <td>4k-8k</td>\n",
       "      <td>运营|编辑|客服类</td>\n",
       "      <td>编辑</td>\n",
       "      <td>文案策划</td>\n",
       "      <td>[策划, 文案, 编辑, 软文]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>497</th>\n",
       "      <td>朝阳区</td>\n",
       "      <td>移动互联网,文娱丨内容</td>\n",
       "      <td>大专</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>10k-15k</td>\n",
       "      <td>运营|编辑|客服类</td>\n",
       "      <td>编辑</td>\n",
       "      <td>文案策划</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>498</th>\n",
       "      <td>拱墅区</td>\n",
       "      <td>广告营销,文娱丨内容</td>\n",
       "      <td>不限</td>\n",
       "      <td>不限</td>\n",
       "      <td>6k-10k</td>\n",
       "      <td>运营|编辑|客服类</td>\n",
       "      <td>编辑</td>\n",
       "      <td>文案策划</td>\n",
       "      <td>[内容, 软文, 视频编辑, 广告]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>499</th>\n",
       "      <td>朝阳区</td>\n",
       "      <td>企业服务</td>\n",
       "      <td>本科</td>\n",
       "      <td>1-3年</td>\n",
       "      <td>4k-7k</td>\n",
       "      <td>市场|商务类</td>\n",
       "      <td>品牌|广告</td>\n",
       "      <td>广告创意</td>\n",
       "      <td>[策划, 公关（PR）, 文案]</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>500 rows × 9 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    district industryField education workYear   salary  firstType secondType  \\\n",
       "0        海淀区         移动互联网        本科     1-3年   8k-15k  运营|编辑|客服类         编辑   \n",
       "1       浦东新区          广告营销        本科     3-5年  10k-16k  运营|编辑|客服类         编辑   \n",
       "2        锦江区          企业服务        本科       不限   8k-15k  运营|编辑|客服类         运营   \n",
       "3        南山区         移动互联网        本科     1-3年   8k-16k  运营|编辑|客服类         编辑   \n",
       "4        朝阳区         文娱丨内容        大专     1-3年   6k-12k  运营|编辑|客服类         编辑   \n",
       "..       ...           ...       ...      ...      ...        ...        ...   \n",
       "495      南沙区         汽车丨出行        本科     3-5年  15k-20k  运营|编辑|客服类         运营   \n",
       "496      鼓楼区     软件开发、企业服务        不限     1-3年    4k-8k  运营|编辑|客服类         编辑   \n",
       "497      朝阳区   移动互联网,文娱丨内容        大专     3-5年  10k-15k  运营|编辑|客服类         编辑   \n",
       "498      拱墅区    广告营销,文娱丨内容        不限       不限   6k-10k  运营|编辑|客服类         编辑   \n",
       "499      朝阳区          企业服务        本科     1-3年    4k-7k     市场|商务类      品牌|广告   \n",
       "\n",
       "    thirdType            skillLables  \n",
       "0        文案策划                   [文案]  \n",
       "1        文案策划               [文案, 策划]  \n",
       "2        其他运营          [新媒体运营, 网络运营]  \n",
       "3        文案策划               [策划, 文案]  \n",
       "4        文案策划           [文案, 策划, 软文]  \n",
       "..        ...                    ...  \n",
       "495      内容运营  [运营, PGC, 策略运营, 用户增长]  \n",
       "496      文案策划       [策划, 文案, 编辑, 软文]  \n",
       "497      文案策划                     []  \n",
       "498      文案策划     [内容, 软文, 视频编辑, 广告]  \n",
       "499      广告创意       [策划, 公关（PR）, 文案]  \n",
       "\n",
       "[500 rows x 9 columns]"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data = get_data()# 调用数据\n",
    "data = pd.DataFrame(data)\n",
    "data.head(500)# 显现其中的500条数据以展示分类效果"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 250,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"07112d67a0ea4da79223c83eb8381444\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_07112d67a0ea4da79223c83eb8381444 = echarts.init(\n",
       "                    document.getElementById('07112d67a0ea4da79223c83eb8381444'), 'white', {renderer: 'canvas'});\n",
       "                var option_07112d67a0ea4da79223c83eb8381444 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"data\": [\n",
       "                141,\n",
       "                122,\n",
       "                110,\n",
       "                55,\n",
       "                50,\n",
       "                50,\n",
       "                48,\n",
       "                43,\n",
       "                40,\n",
       "                36,\n",
       "                25,\n",
       "                24,\n",
       "                23,\n",
       "                22,\n",
       "                22,\n",
       "                20,\n",
       "                17,\n",
       "                15,\n",
       "                15,\n",
       "                15\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\": true\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u5929\\u6cb3\\u533a\",\n",
       "                \"\\u5357\\u5c71\\u533a\",\n",
       "                \"\\u671d\\u9633\\u533a\",\n",
       "                \"\\u6d77\\u6dc0\\u533a\",\n",
       "                \"\\u9ad8\\u65b0\\u533a\",\n",
       "                \"\\u6d77\\u73e0\\u533a\",\n",
       "                \"\\u798f\\u7530\\u533a\",\n",
       "                \"\\u6d66\\u4e1c\\u65b0\\u533a\",\n",
       "                \"\\u6ee8\\u6c5f\\u533a\",\n",
       "                \"\\u5f90\\u6c47\\u533a\",\n",
       "                \"\\u756a\\u79ba\\u533a\",\n",
       "                \"\\u5b9d\\u5b89\\u533a\",\n",
       "                \"\\u95f5\\u884c\\u533a\",\n",
       "                \"\\u767d\\u4e91\\u533a\",\n",
       "                \"\\u8d8a\\u79c0\\u533a\",\n",
       "                \"\\u4f59\\u676d\\u533a\",\n",
       "                \"\\u957f\\u5b81\\u533a\",\n",
       "                \"\\u897f\\u6e56\\u533a\",\n",
       "                \"\\u9f99\\u5c97\\u533a\",\n",
       "                \"\\u666e\\u9640\\u533a\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_07112d67a0ea4da79223c83eb8381444.setOption(option_07112d67a0ea4da79223c83eb8381444);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1ba79349160>"
      ]
     },
     "execution_count": 250,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "citys_value_counts = data['district'].value_counts() # 选取区域标签进行整合\n",
    "top = 20 # 选取前20的地区\n",
    "citys = list(citys_value_counts.head(top).index)\n",
    "city_counts = list(citys_value_counts.head(top))\n",
    "\n",
    "bar = (\n",
    "    Bar()\n",
    "        .add_xaxis(citys)\n",
    "        .add_yaxis(\"\", city_counts)\n",
    ")\n",
    "bar.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 从图表可以看出 广州天河区对文案相关职业的需求最高"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 210,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"aaf2ba45706e4225b2a493d96ff6fe8f\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_aaf2ba45706e4225b2a493d96ff6fe8f = echarts.init(\n",
       "                    document.getElementById('aaf2ba45706e4225b2a493d96ff6fe8f'), 'white', {renderer: 'canvas'});\n",
       "                var option_aaf2ba45706e4225b2a493d96ff6fe8f = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u79fb\\u52a8\\u4e92\\u8054\\u7f51\",\n",
       "                    \"value\": 498\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u7535\\u5546\",\n",
       "                    \"value\": 298\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u544a\\u8425\\u9500\",\n",
       "                    \"value\": 193\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4f01\\u4e1a\\u670d\\u52a1\",\n",
       "                    \"value\": 139\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6587\\u5a31\\u4e28\\u5185\\u5bb9\",\n",
       "                    \"value\": 129\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6e38\\u620f\",\n",
       "                    \"value\": 128\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6559\\u80b2\",\n",
       "                    \"value\": 105\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5176\\u4ed6\",\n",
       "                    \"value\": 82\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6d88\\u8d39\\u751f\\u6d3b\",\n",
       "                    \"value\": 76\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u533b\\u7597\\u4e28\\u5065\\u5eb7\",\n",
       "                    \"value\": 71\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u91d1\\u878d\",\n",
       "                    \"value\": 55\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6570\\u636e\\u670d\\u52a1\",\n",
       "                    \"value\": 53\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u793e\\u4ea4\",\n",
       "                    \"value\": 34\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8f6f\\u4ef6\\u5f00\\u53d1\",\n",
       "                    \"value\": 26\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u786c\\u4ef6\",\n",
       "                    \"value\": 16\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4eba\\u5de5\\u667a\\u80fd\",\n",
       "                    \"value\": 14\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u65c5\\u6e38\",\n",
       "                    \"value\": 13\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u623f\\u4ea7\\u5bb6\\u5c45\",\n",
       "                    \"value\": 12\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4fe1\\u606f\\u5b89\\u5168\",\n",
       "                    \"value\": 10\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u533a\\u5757\\u94fe\",\n",
       "                    \"value\": 9\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"0%\",\n",
       "                \"75%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"50%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u79fb\\u52a8\\u4e92\\u8054\\u7f51\",\n",
       "                \"\\u7535\\u5546\",\n",
       "                \"\\u5e7f\\u544a\\u8425\\u9500\",\n",
       "                \"\\u4f01\\u4e1a\\u670d\\u52a1\",\n",
       "                \"\\u6587\\u5a31\\u4e28\\u5185\\u5bb9\",\n",
       "                \"\\u6e38\\u620f\",\n",
       "                \"\\u6559\\u80b2\",\n",
       "                \"\\u5176\\u4ed6\",\n",
       "                \"\\u6d88\\u8d39\\u751f\\u6d3b\",\n",
       "                \"\\u533b\\u7597\\u4e28\\u5065\\u5eb7\",\n",
       "                \"\\u91d1\\u878d\",\n",
       "                \"\\u6570\\u636e\\u670d\\u52a1\",\n",
       "                \"\\u793e\\u4ea4\",\n",
       "                \"\\u8f6f\\u4ef6\\u5f00\\u53d1\",\n",
       "                \"\\u786c\\u4ef6\",\n",
       "                \"\\u4eba\\u5de5\\u667a\\u80fd\",\n",
       "                \"\\u65c5\\u6e38\",\n",
       "                \"\\u623f\\u4ea7\\u5bb6\\u5c45\",\n",
       "                \"\\u4fe1\\u606f\\u5b89\\u5168\",\n",
       "                \"\\u533a\\u5757\\u94fe\"\n",
       "            ],\n",
       "            \"selected\": {},\n",
       "            \"show\": false,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"title\": [\n",
       "        {}\n",
       "    ]\n",
       "};\n",
       "                chart_aaf2ba45706e4225b2a493d96ff6fe8f.setOption(option_aaf2ba45706e4225b2a493d96ff6fe8f);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1ba7925aef0>"
      ]
     },
     "execution_count": 210,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "industrys = list(data['industryField']) # 选取行业标签进行整合\n",
    "industry_list = [i for item in industrys for i in item.split(',')]\n",
    "\n",
    "industry_series = pd.Series(data=industry_list)\n",
    "industry_value_counts = industry_series.value_counts()\n",
    "\n",
    "industrys = list(industry_value_counts.head(top).index)\n",
    "industry_counts = list(industry_value_counts.head(top))\n",
    "\n",
    "pie = (  # 调用pyechart的饼图模块\n",
    "    Pie()\n",
    "        .add(\"\", [list(z) for z in zip(industrys, industry_counts)])\n",
    "        .set_global_opts(title_opts=opts.TitleOpts(title=\"\"))\n",
    "        .set_global_opts(legend_opts=opts.LegendOpts(is_show=False))\n",
    ")\n",
    "pie.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 从饼图中可以看出 绝大多数的文案相关职位需求集中在移动互联网、电商、广告营销等传统行业 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 211,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"d7b46cbcf7484c3fbf930ae6aa452835\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_d7b46cbcf7484c3fbf930ae6aa452835 = echarts.init(\n",
       "                    document.getElementById('d7b46cbcf7484c3fbf930ae6aa452835'), 'white', {renderer: 'canvas'});\n",
       "                var option_d7b46cbcf7484c3fbf930ae6aa452835 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u672c\\u79d1\",\n",
       "                    \"value\": 832\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5927\\u4e13\",\n",
       "                    \"value\": 424\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e0d\\u9650\",\n",
       "                    \"value\": 121\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u7855\\u58eb\",\n",
       "                    \"value\": 3\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"0%\",\n",
       "                \"75%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"50%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u672c\\u79d1\",\n",
       "                \"\\u5927\\u4e13\",\n",
       "                \"\\u4e0d\\u9650\",\n",
       "                \"\\u7855\\u58eb\"\n",
       "            ],\n",
       "            \"selected\": {},\n",
       "            \"show\": false,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"title\": [\n",
       "        {}\n",
       "    ]\n",
       "};\n",
       "                chart_d7b46cbcf7484c3fbf930ae6aa452835.setOption(option_d7b46cbcf7484c3fbf930ae6aa452835);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1ba791fd240>"
      ]
     },
     "execution_count": 211,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "eduction_value_counts = data['education'].value_counts() # 选取学历标签进行整合\n",
    "\n",
    "eduction = list(eduction_value_counts.index)\n",
    "eduction_counts = list(eduction_value_counts)\n",
    "\n",
    "pie = (\n",
    "    Pie()\n",
    "        .add(\"\", [list(z) for z in zip(eduction, eduction_counts)])\n",
    "        .set_global_opts(title_opts=opts.TitleOpts(title=\"\"))\n",
    "        .set_global_opts(legend_opts=opts.LegendOpts(is_show=False))\n",
    ")\n",
    "pie.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 从饼图中可以看出 绝大多数的文案相关职位对学历的要求都是达到本科学历"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 212,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"d6d6ee7772e842cfa9e1839f50c862b5\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_d6d6ee7772e842cfa9e1839f50c862b5 = echarts.init(\n",
       "                    document.getElementById('d6d6ee7772e842cfa9e1839f50c862b5'), 'white', {renderer: 'canvas'});\n",
       "                var option_d6d6ee7772e842cfa9e1839f50c862b5 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"data\": [\n",
       "                678,\n",
       "                326,\n",
       "                237,\n",
       "                62,\n",
       "                42,\n",
       "                35\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\": true\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"1-3\\u5e74\",\n",
       "                \"3-5\\u5e74\",\n",
       "                \"\\u4e0d\\u9650\",\n",
       "                \"\\u5e94\\u5c4a\\u6bd5\\u4e1a\\u751f\",\n",
       "                \"5-10\\u5e74\",\n",
       "                \"1\\u5e74\\u4ee5\\u4e0b\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_d6d6ee7772e842cfa9e1839f50c862b5.setOption(option_d6d6ee7772e842cfa9e1839f50c862b5);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1ba7925ae80>"
      ]
     },
     "execution_count": 212,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "work_year_value_counts = data['workYear'].value_counts() # 工作经验作为标签进行整合\n",
    "work_year = list(work_year_value_counts.index)\n",
    "work_year_counts = list(work_year_value_counts)\n",
    "\n",
    "bar = (\n",
    "    Bar()\n",
    "        .add_xaxis(work_year)\n",
    "        .add_yaxis(\"\", work_year_counts)\n",
    ")\n",
    "bar.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 从图表出可以看出用人单位对工作经验1-3年的员工的需求量最大 令人惊奇的是应届毕业生居然也占据了一席之地"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 213,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"27e3dff688b740e7a6a5de76b12e2980\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_27e3dff688b740e7a6a5de76b12e2980 = echarts.init(\n",
       "                    document.getElementById('27e3dff688b740e7a6a5de76b12e2980'), 'white', {renderer: 'canvas'});\n",
       "                var option_27e3dff688b740e7a6a5de76b12e2980 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"data\": [\n",
       "                87,\n",
       "                85,\n",
       "                71,\n",
       "                70,\n",
       "                68,\n",
       "                65,\n",
       "                60,\n",
       "                58,\n",
       "                53,\n",
       "                48,\n",
       "                47,\n",
       "                43,\n",
       "                37,\n",
       "                36,\n",
       "                35,\n",
       "                29,\n",
       "                26,\n",
       "                25,\n",
       "                25,\n",
       "                24\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"name\": \"\\u85aa\\u8d44\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"nameRotate\": 0,\n",
       "            \"gridIndex\": 0,\n",
       "            \"axisLabel\": {\n",
       "                \"rotate\": 45\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"6k-10k\",\n",
       "                \"4k-6k\",\n",
       "                \"6k-8k\",\n",
       "                \"4k-8k\",\n",
       "                \"5k-8k\",\n",
       "                \"10k-15k\",\n",
       "                \"10k-20k\",\n",
       "                \"8k-15k\",\n",
       "                \"8k-12k\",\n",
       "                \"5k-10k\",\n",
       "                \"6k-12k\",\n",
       "                \"8k-10k\",\n",
       "                \"7k-10k\",\n",
       "                \"5k-7k\",\n",
       "                \"6k-9k\",\n",
       "                \"15k-25k\",\n",
       "                \"7k-12k\",\n",
       "                \"4k-7k\",\n",
       "                \"3k-5k\",\n",
       "                \"8k-16k\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {}\n",
       "    ]\n",
       "};\n",
       "                chart_27e3dff688b740e7a6a5de76b12e2980.setOption(option_27e3dff688b740e7a6a5de76b12e2980);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1ba791fdc50>"
      ]
     },
     "execution_count": 213,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "salary_value_counts = data['salary'].value_counts() # 选取工资标签进行整合\n",
    "salary = list(salary_value_counts.head(top).index)\n",
    "salary_counts = list(salary_value_counts.head(top))\n",
    "\n",
    "bar = (\n",
    "    Bar()\n",
    "        .add_xaxis(salary)\n",
    "        .add_yaxis(\"\", salary_counts)\n",
    "        .set_global_opts(xaxis_opts=opts.AxisOpts(name_rotate=0, name=\"薪资\", axislabel_opts={\"rotate\": 45}))\n",
    ")\n",
    "bar.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 图表显示 各薪资阶段的职位分布都较为平均 结合行业进行分析会更有参考价值"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 2.将传统行业与网新相关行业文案相关工作薪资进行对比"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 243,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np # 载入所需模块\n",
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Bar\n",
    "from pyecharts.charts import Pie\n",
    "from wordcloud import WordCloud\n",
    "import matplotlib.pyplot as plt\n",
    "import json\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 移动互联网分类薪资分布图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 216,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_data():\n",
    "    with open('移动互联网分类.txt',encoding='utf-8') as f: # 选取要分析的行业数据\n",
    "        data = []\n",
    "        for line in f.readlines():\n",
    "            result = json.loads(line)\n",
    "            result_list = result['content']['positionResult']['result']\n",
    "            for item in result_list:\n",
    "                dict = {\n",
    "                    'city': item['city'],\n",
    "                   'district': item['district'],\n",
    "                    'industryField': item['industryField'],\n",
    "                    'education': item['education'],\n",
    "                    'workYear': item['workYear'],\n",
    "                    'salary': item['salary'],\n",
    "                    'firstType': item['firstType'],\n",
    "                    'secondType': item['secondType'],\n",
    "                    'thirdType': item['thirdType'],\n",
    "                    'skillLables': item['skillLables']\n",
    "                }\n",
    "                data.append(dict)\n",
    "        return data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 217,
   "metadata": {},
   "outputs": [],
   "source": [
    "data = get_data()\n",
    "data = pd.DataFrame(data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 218,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"80018760f62b4b26979d2f53d1aa8faf\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_80018760f62b4b26979d2f53d1aa8faf = echarts.init(\n",
       "                    document.getElementById('80018760f62b4b26979d2f53d1aa8faf'), 'white', {renderer: 'canvas'});\n",
       "                var option_80018760f62b4b26979d2f53d1aa8faf = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"data\": [\n",
       "                14,\n",
       "                9,\n",
       "                9,\n",
       "                8,\n",
       "                8,\n",
       "                8,\n",
       "                8,\n",
       "                7,\n",
       "                6,\n",
       "                5,\n",
       "                5,\n",
       "                5,\n",
       "                5,\n",
       "                4,\n",
       "                4,\n",
       "                3,\n",
       "                3,\n",
       "                3,\n",
       "                3,\n",
       "                3\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"name\": \"\\u85aa\\u8d44\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"nameRotate\": 0,\n",
       "            \"gridIndex\": 0,\n",
       "            \"axisLabel\": {\n",
       "                \"rotate\": 45\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"6k-10k\",\n",
       "                \"5k-8k\",\n",
       "                \"4k-8k\",\n",
       "                \"4k-6k\",\n",
       "                \"10k-15k\",\n",
       "                \"10k-20k\",\n",
       "                \"8k-15k\",\n",
       "                \"15k-25k\",\n",
       "                \"6k-12k\",\n",
       "                \"6k-8k\",\n",
       "                \"8k-12k\",\n",
       "                \"8k-16k\",\n",
       "                \"6k-9k\",\n",
       "                \"8k-13k\",\n",
       "                \"5k-10k\",\n",
       "                \"6k-11k\",\n",
       "                \"2k-3k\",\n",
       "                \"7k-10k\",\n",
       "                \"3k-5k\",\n",
       "                \"7k-9k\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {}\n",
       "    ]\n",
       "};\n",
       "                chart_80018760f62b4b26979d2f53d1aa8faf.setOption(option_80018760f62b4b26979d2f53d1aa8faf);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1ba77c1b438>"
      ]
     },
     "execution_count": 218,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "salary_value_counts = data['salary'].value_counts()\n",
    "salary = list(salary_value_counts.head(top).index)\n",
    "salary_counts = list(salary_value_counts.head(top))\n",
    "\n",
    "bar = (\n",
    "    Bar()\n",
    "        .add_xaxis(salary)\n",
    "        .add_yaxis(\"\", salary_counts)\n",
    "        .set_global_opts(xaxis_opts=opts.AxisOpts(name_rotate=0, name=\"薪资\", axislabel_opts={\"rotate\": 45}))\n",
    ")\n",
    "bar.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 文娱内容分类薪资分布图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 220,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_data():\n",
    "    with open('文娱内容分类.txt',encoding='utf-8') as f:\n",
    "        data = []\n",
    "        for line in f.readlines():\n",
    "            result = json.loads(line)\n",
    "            result_list = result['content']['positionResult']['result']\n",
    "            for item in result_list:\n",
    "                dict = {\n",
    "                    'city': item['city'],\n",
    "                   'district': item['district'],\n",
    "                    'industryField': item['industryField'],\n",
    "                    'education': item['education'],\n",
    "                    'workYear': item['workYear'],\n",
    "                    'salary': item['salary'],\n",
    "                    'firstType': item['firstType'],\n",
    "                    'secondType': item['secondType'],\n",
    "                    'thirdType': item['thirdType'],\n",
    "                    'skillLables': item['skillLables']\n",
    "                }\n",
    "                data.append(dict)\n",
    "        return data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 221,
   "metadata": {},
   "outputs": [],
   "source": [
    "data = get_data()\n",
    "data = pd.DataFrame(data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 222,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"9186149caec943008984d2dc20831786\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_9186149caec943008984d2dc20831786 = echarts.init(\n",
       "                    document.getElementById('9186149caec943008984d2dc20831786'), 'white', {renderer: 'canvas'});\n",
       "                var option_9186149caec943008984d2dc20831786 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"data\": [\n",
       "                19,\n",
       "                15,\n",
       "                14,\n",
       "                13,\n",
       "                12,\n",
       "                12,\n",
       "                12,\n",
       "                10,\n",
       "                10,\n",
       "                9,\n",
       "                9,\n",
       "                8,\n",
       "                8,\n",
       "                7,\n",
       "                6,\n",
       "                6,\n",
       "                6,\n",
       "                5,\n",
       "                5,\n",
       "                4\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"name\": \"\\u85aa\\u8d44\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"nameRotate\": 0,\n",
       "            \"gridIndex\": 0,\n",
       "            \"axisLabel\": {\n",
       "                \"rotate\": 45\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"6k-10k\",\n",
       "                \"10k-15k\",\n",
       "                \"4k-6k\",\n",
       "                \"8k-15k\",\n",
       "                \"10k-20k\",\n",
       "                \"5k-8k\",\n",
       "                \"8k-12k\",\n",
       "                \"6k-8k\",\n",
       "                \"4k-8k\",\n",
       "                \"6k-12k\",\n",
       "                \"15k-25k\",\n",
       "                \"6k-9k\",\n",
       "                \"5k-10k\",\n",
       "                \"8k-16k\",\n",
       "                \"7k-10k\",\n",
       "                \"8k-10k\",\n",
       "                \"5k-7k\",\n",
       "                \"8k-13k\",\n",
       "                \"2k-3k\",\n",
       "                \"7k-12k\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {}\n",
       "    ]\n",
       "};\n",
       "                chart_9186149caec943008984d2dc20831786.setOption(option_9186149caec943008984d2dc20831786);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1ba79337dd8>"
      ]
     },
     "execution_count": 222,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "salary_value_counts = data['salary'].value_counts()\n",
    "salary = list(salary_value_counts.head(top).index)\n",
    "salary_counts = list(salary_value_counts.head(top))\n",
    "\n",
    "bar = (\n",
    "    Bar()\n",
    "        .add_xaxis(salary)\n",
    "        .add_yaxis(\"\", salary_counts)\n",
    "        .set_global_opts(xaxis_opts=opts.AxisOpts(name_rotate=0, name=\"薪资\", axislabel_opts={\"rotate\": 45}))\n",
    ")\n",
    "bar.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 广告营销分类薪资分布图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 224,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_data():\n",
    "    with open('广告营销分类.txt',encoding='utf-8') as f:\n",
    "        data = []\n",
    "        for line in f.readlines():\n",
    "            result = json.loads(line)\n",
    "            result_list = result['content']['positionResult']['result']\n",
    "            for item in result_list:\n",
    "                dict = {\n",
    "                    'city': item['city'],\n",
    "                   'district': item['district'],\n",
    "                    'industryField': item['industryField'],\n",
    "                    'education': item['education'],\n",
    "                    'workYear': item['workYear'],\n",
    "                    'salary': item['salary'],\n",
    "                    'firstType': item['firstType'],\n",
    "                    'secondType': item['secondType'],\n",
    "                    'thirdType': item['thirdType'],\n",
    "                    'skillLables': item['skillLables']\n",
    "                }\n",
    "                data.append(dict)\n",
    "        return data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 225,
   "metadata": {},
   "outputs": [],
   "source": [
    "data = get_data()\n",
    "data = pd.DataFrame(data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 226,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"ee78b82fb9214093aefa8ba4660d2eda\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_ee78b82fb9214093aefa8ba4660d2eda = echarts.init(\n",
       "                    document.getElementById('ee78b82fb9214093aefa8ba4660d2eda'), 'white', {renderer: 'canvas'});\n",
       "                var option_ee78b82fb9214093aefa8ba4660d2eda = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"data\": [\n",
       "                8,\n",
       "                8,\n",
       "                7,\n",
       "                7,\n",
       "                5,\n",
       "                5,\n",
       "                5,\n",
       "                4,\n",
       "                4,\n",
       "                4,\n",
       "                3,\n",
       "                3,\n",
       "                3,\n",
       "                3,\n",
       "                2,\n",
       "                2,\n",
       "                2,\n",
       "                2,\n",
       "                2,\n",
       "                2\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"name\": \"\\u85aa\\u8d44\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"nameRotate\": 0,\n",
       "            \"gridIndex\": 0,\n",
       "            \"axisLabel\": {\n",
       "                \"rotate\": 45\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"4k-8k\",\n",
       "                \"6k-10k\",\n",
       "                \"4k-6k\",\n",
       "                \"5k-8k\",\n",
       "                \"8k-15k\",\n",
       "                \"15k-25k\",\n",
       "                \"8k-16k\",\n",
       "                \"10k-15k\",\n",
       "                \"6k-8k\",\n",
       "                \"6k-9k\",\n",
       "                \"5k-10k\",\n",
       "                \"2k-3k\",\n",
       "                \"10k-20k\",\n",
       "                \"6k-12k\",\n",
       "                \"8k-13k\",\n",
       "                \"13k-23k\",\n",
       "                \"14k-24k\",\n",
       "                \"8k-12k\",\n",
       "                \"6k-7k\",\n",
       "                \"3k-5k\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {}\n",
       "    ]\n",
       "};\n",
       "                chart_ee78b82fb9214093aefa8ba4660d2eda.setOption(option_ee78b82fb9214093aefa8ba4660d2eda);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1ba78096208>"
      ]
     },
     "execution_count": 226,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "salary_value_counts = data['salary'].value_counts()\n",
    "salary = list(salary_value_counts.head(top).index)\n",
    "salary_counts = list(salary_value_counts.head(top))\n",
    "\n",
    "bar = (\n",
    "    Bar()\n",
    "        .add_xaxis(salary)\n",
    "        .add_yaxis(\"\", salary_counts)\n",
    "        .set_global_opts(xaxis_opts=opts.AxisOpts(name_rotate=0, name=\"薪资\", axislabel_opts={\"rotate\": 45}))\n",
    ")\n",
    "bar.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 电商分类薪资分布图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 228,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_data():\n",
    "    with open('电商分类.txt',encoding='utf-8') as f:\n",
    "        data = []\n",
    "        for line in f.readlines():\n",
    "            result = json.loads(line)\n",
    "            result_list = result['content']['positionResult']['result']\n",
    "            for item in result_list:\n",
    "                dict = {\n",
    "                    'city': item['city'],\n",
    "                   'district': item['district'],\n",
    "                    'industryField': item['industryField'],\n",
    "                    'education': item['education'],\n",
    "                    'workYear': item['workYear'],\n",
    "                    'salary': item['salary'],\n",
    "                    'firstType': item['firstType'],\n",
    "                    'secondType': item['secondType'],\n",
    "                    'thirdType': item['thirdType'],\n",
    "                    'skillLables': item['skillLables']\n",
    "                }\n",
    "                data.append(dict)\n",
    "        return data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 229,
   "metadata": {},
   "outputs": [],
   "source": [
    "data = get_data()\n",
    "data = pd.DataFrame(data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 230,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"3a2498d9303249bc8be4fbdd48933689\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_3a2498d9303249bc8be4fbdd48933689 = echarts.init(\n",
       "                    document.getElementById('3a2498d9303249bc8be4fbdd48933689'), 'white', {renderer: 'canvas'});\n",
       "                var option_3a2498d9303249bc8be4fbdd48933689 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"data\": [\n",
       "                13,\n",
       "                9,\n",
       "                9,\n",
       "                9,\n",
       "                8,\n",
       "                6,\n",
       "                6,\n",
       "                6,\n",
       "                5,\n",
       "                5,\n",
       "                4,\n",
       "                4,\n",
       "                4,\n",
       "                4,\n",
       "                3,\n",
       "                3,\n",
       "                3,\n",
       "                3,\n",
       "                3,\n",
       "                2\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"name\": \"\\u85aa\\u8d44\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"nameRotate\": 0,\n",
       "            \"gridIndex\": 0,\n",
       "            \"axisLabel\": {\n",
       "                \"rotate\": 45\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"6k-10k\",\n",
       "                \"8k-15k\",\n",
       "                \"4k-8k\",\n",
       "                \"5k-8k\",\n",
       "                \"4k-6k\",\n",
       "                \"15k-25k\",\n",
       "                \"10k-15k\",\n",
       "                \"6k-12k\",\n",
       "                \"8k-16k\",\n",
       "                \"10k-20k\",\n",
       "                \"6k-8k\",\n",
       "                \"8k-12k\",\n",
       "                \"6k-9k\",\n",
       "                \"5k-10k\",\n",
       "                \"5k-7k\",\n",
       "                \"3k-5k\",\n",
       "                \"8k-13k\",\n",
       "                \"6k-11k\",\n",
       "                \"2k-3k\",\n",
       "                \"20k-40k\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {}\n",
       "    ]\n",
       "};\n",
       "                chart_3a2498d9303249bc8be4fbdd48933689.setOption(option_3a2498d9303249bc8be4fbdd48933689);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1ba74a1cac8>"
      ]
     },
     "execution_count": 230,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "salary_value_counts = data['salary'].value_counts()\n",
    "salary = list(salary_value_counts.head(top).index)\n",
    "salary_counts = list(salary_value_counts.head(top))\n",
    "\n",
    "bar = (\n",
    "    Bar()\n",
    "        .add_xaxis(salary)\n",
    "        .add_yaxis(\"\", salary_counts)\n",
    "        .set_global_opts(xaxis_opts=opts.AxisOpts(name_rotate=0, name=\"薪资\", axislabel_opts={\"rotate\": 45}))\n",
    ")\n",
    "bar.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 企业服务分类薪资分布图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 232,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_data():\n",
    "    with open('企业服务分类.txt',encoding='utf-8') as f:\n",
    "        data = []\n",
    "        for line in f.readlines():\n",
    "            result = json.loads(line)\n",
    "            result_list = result['content']['positionResult']['result']\n",
    "            for item in result_list:\n",
    "                dict = {\n",
    "                    'city': item['city'],\n",
    "                   'district': item['district'],\n",
    "                    'industryField': item['industryField'],\n",
    "                    'education': item['education'],\n",
    "                    'workYear': item['workYear'],\n",
    "                    'salary': item['salary'],\n",
    "                    'firstType': item['firstType'],\n",
    "                    'secondType': item['secondType'],\n",
    "                    'thirdType': item['thirdType'],\n",
    "                    'skillLables': item['skillLables']\n",
    "                }\n",
    "                data.append(dict)\n",
    "        return data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 233,
   "metadata": {},
   "outputs": [],
   "source": [
    "data = get_data()\n",
    "data = pd.DataFrame(data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 234,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"d6cff78b619649ce82684bf2d5c6da0a\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_d6cff78b619649ce82684bf2d5c6da0a = echarts.init(\n",
       "                    document.getElementById('d6cff78b619649ce82684bf2d5c6da0a'), 'white', {renderer: 'canvas'});\n",
       "                var option_d6cff78b619649ce82684bf2d5c6da0a = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"data\": [\n",
       "                15,\n",
       "                11,\n",
       "                10,\n",
       "                9,\n",
       "                9,\n",
       "                9,\n",
       "                9,\n",
       "                9,\n",
       "                8,\n",
       "                8,\n",
       "                7,\n",
       "                7,\n",
       "                7,\n",
       "                6,\n",
       "                6,\n",
       "                5,\n",
       "                5,\n",
       "                5,\n",
       "                4,\n",
       "                4\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"name\": \"\\u85aa\\u8d44\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"nameRotate\": 0,\n",
       "            \"gridIndex\": 0,\n",
       "            \"axisLabel\": {\n",
       "                \"rotate\": 45\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"6k-10k\",\n",
       "                \"10k-20k\",\n",
       "                \"4k-6k\",\n",
       "                \"10k-15k\",\n",
       "                \"8k-15k\",\n",
       "                \"5k-8k\",\n",
       "                \"4k-8k\",\n",
       "                \"8k-12k\",\n",
       "                \"6k-12k\",\n",
       "                \"15k-25k\",\n",
       "                \"6k-8k\",\n",
       "                \"6k-9k\",\n",
       "                \"5k-10k\",\n",
       "                \"8k-16k\",\n",
       "                \"5k-7k\",\n",
       "                \"8k-13k\",\n",
       "                \"7k-10k\",\n",
       "                \"8k-10k\",\n",
       "                \"4k-7k\",\n",
       "                \"2k-3k\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {}\n",
       "    ]\n",
       "};\n",
       "                chart_d6cff78b619649ce82684bf2d5c6da0a.setOption(option_d6cff78b619649ce82684bf2d5c6da0a);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1ba76145cf8>"
      ]
     },
     "execution_count": 234,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "salary_value_counts = data['salary'].value_counts()\n",
    "salary = list(salary_value_counts.head(top).index)\n",
    "salary_counts = list(salary_value_counts.head(top))\n",
    "\n",
    "bar = (\n",
    "    Bar()\n",
    "        .add_xaxis(salary)\n",
    "        .add_yaxis(\"\", salary_counts)\n",
    "        .set_global_opts(xaxis_opts=opts.AxisOpts(name_rotate=0, name=\"薪资\", axislabel_opts={\"rotate\": 45}))\n",
    ")\n",
    "bar.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 数据服务分类薪资分布图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 236,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_data():\n",
    "    with open('数据服务分类.txt',encoding='utf-8') as f:\n",
    "        data = []\n",
    "        for line in f.readlines():\n",
    "            result = json.loads(line)\n",
    "            result_list = result['content']['positionResult']['result']\n",
    "            for item in result_list:\n",
    "                dict = {\n",
    "                    'city': item['city'],\n",
    "                   'district': item['district'],\n",
    "                    'industryField': item['industryField'],\n",
    "                    'education': item['education'],\n",
    "                    'workYear': item['workYear'],\n",
    "                    'salary': item['salary'],\n",
    "                    'firstType': item['firstType'],\n",
    "                    'secondType': item['secondType'],\n",
    "                    'thirdType': item['thirdType'],\n",
    "                    'skillLables': item['skillLables']\n",
    "                }\n",
    "                data.append(dict)\n",
    "        return data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 237,
   "metadata": {},
   "outputs": [],
   "source": [
    "data = get_data()\n",
    "data = pd.DataFrame(data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 238,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"4e1d31f2e1864578a5a4ba10c149bfed\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_4e1d31f2e1864578a5a4ba10c149bfed = echarts.init(\n",
       "                    document.getElementById('4e1d31f2e1864578a5a4ba10c149bfed'), 'white', {renderer: 'canvas'});\n",
       "                var option_4e1d31f2e1864578a5a4ba10c149bfed = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"data\": [\n",
       "                8,\n",
       "                7,\n",
       "                6,\n",
       "                5,\n",
       "                5,\n",
       "                5,\n",
       "                4,\n",
       "                4,\n",
       "                4,\n",
       "                3,\n",
       "                3,\n",
       "                3,\n",
       "                2,\n",
       "                2,\n",
       "                2,\n",
       "                2,\n",
       "                2,\n",
       "                2,\n",
       "                1,\n",
       "                1\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"name\": \"\\u85aa\\u8d44\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"nameRotate\": 0,\n",
       "            \"gridIndex\": 0,\n",
       "            \"axisLabel\": {\n",
       "                \"rotate\": 45\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"6k-10k\",\n",
       "                \"4k-8k\",\n",
       "                \"4k-6k\",\n",
       "                \"15k-25k\",\n",
       "                \"8k-15k\",\n",
       "                \"5k-8k\",\n",
       "                \"6k-8k\",\n",
       "                \"10k-15k\",\n",
       "                \"8k-16k\",\n",
       "                \"5k-10k\",\n",
       "                \"6k-9k\",\n",
       "                \"2k-3k\",\n",
       "                \"13k-23k\",\n",
       "                \"3k-5k\",\n",
       "                \"5k-7k\",\n",
       "                \"20k-40k\",\n",
       "                \"10k-20k\",\n",
       "                \"14k-24k\",\n",
       "                \"5k-6k\",\n",
       "                \"8k-10k\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {}\n",
       "    ]\n",
       "};\n",
       "                chart_4e1d31f2e1864578a5a4ba10c149bfed.setOption(option_4e1d31f2e1864578a5a4ba10c149bfed);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1ba77e80390>"
      ]
     },
     "execution_count": 238,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "salary_value_counts = data['salary'].value_counts()\n",
    "salary = list(salary_value_counts.head(top).index)\n",
    "salary_counts = list(salary_value_counts.head(top))\n",
    "\n",
    "bar = (\n",
    "    Bar()\n",
    "        .add_xaxis(salary)\n",
    "        .add_yaxis(\"\", salary_counts)\n",
    "        .set_global_opts(xaxis_opts=opts.AxisOpts(name_rotate=0, name=\"薪资\", axislabel_opts={\"rotate\": 45}))\n",
    ")\n",
    "bar.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 人工智能分类薪资分布图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 240,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_data():\n",
    "    with open('人工智能分类.txt',encoding='utf-8') as f:\n",
    "        data = []\n",
    "        for line in f.readlines():\n",
    "            result = json.loads(line)\n",
    "            result_list = result['content']['positionResult']['result']\n",
    "            for item in result_list:\n",
    "                dict = {\n",
    "                    'city': item['city'],\n",
    "                   'district': item['district'],\n",
    "                    'industryField': item['industryField'],\n",
    "                    'education': item['education'],\n",
    "                    'workYear': item['workYear'],\n",
    "                    'salary': item['salary'],\n",
    "                    'firstType': item['firstType'],\n",
    "                    'secondType': item['secondType'],\n",
    "                    'thirdType': item['thirdType'],\n",
    "                    'skillLables': item['skillLables']\n",
    "                }\n",
    "                data.append(dict)\n",
    "        return data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 241,
   "metadata": {},
   "outputs": [],
   "source": [
    "data = get_data()\n",
    "data = pd.DataFrame(data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 242,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"d3713592fa0d48c8bfe7f727c0ea4d48\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_d3713592fa0d48c8bfe7f727c0ea4d48 = echarts.init(\n",
       "                    document.getElementById('d3713592fa0d48c8bfe7f727c0ea4d48'), 'white', {renderer: 'canvas'});\n",
       "                var option_d3713592fa0d48c8bfe7f727c0ea4d48 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"data\": [\n",
       "                3,\n",
       "                2,\n",
       "                1,\n",
       "                1,\n",
       "                1,\n",
       "                1,\n",
       "                1,\n",
       "                1,\n",
       "                1,\n",
       "                1,\n",
       "                1,\n",
       "                1\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"name\": \"\\u85aa\\u8d44\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"nameRotate\": 0,\n",
       "            \"gridIndex\": 0,\n",
       "            \"axisLabel\": {\n",
       "                \"rotate\": 45\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"8k-15k\",\n",
       "                \"8k-16k\",\n",
       "                \"6k-8k\",\n",
       "                \"6k-11k\",\n",
       "                \"10k-16k\",\n",
       "                \"100k-150k\",\n",
       "                \"4k-8k\",\n",
       "                \"20k-30k\",\n",
       "                \"6k-10k\",\n",
       "                \"5k-8k\",\n",
       "                \"20k-40k\",\n",
       "                \"4k-6k\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {}\n",
       "    ]\n",
       "};\n",
       "                chart_d3713592fa0d48c8bfe7f727c0ea4d48.setOption(option_d3713592fa0d48c8bfe7f727c0ea4d48);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1ba7740f358>"
      ]
     },
     "execution_count": 242,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "salary_value_counts = data['salary'].value_counts()\n",
    "salary = list(salary_value_counts.head(top).index)\n",
    "salary_counts = list(salary_value_counts.head(top))\n",
    "\n",
    "bar = (\n",
    "    Bar()\n",
    "        .add_xaxis(salary)\n",
    "        .add_yaxis(\"\", salary_counts)\n",
    "        .set_global_opts(xaxis_opts=opts.AxisOpts(name_rotate=0, name=\"薪资\", axislabel_opts={\"rotate\": 45}))\n",
    ")\n",
    "bar.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 软件开发分类薪资分布图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 244,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_data():\n",
    "    with open('软件开发分类.txt',encoding='utf-8') as f:\n",
    "        data = []\n",
    "        for line in f.readlines():\n",
    "            result = json.loads(line)\n",
    "            result_list = result['content']['positionResult']['result']\n",
    "            for item in result_list:\n",
    "                dict = {\n",
    "                    'city': item['city'],\n",
    "                   'district': item['district'],\n",
    "                    'industryField': item['industryField'],\n",
    "                    'education': item['education'],\n",
    "                    'workYear': item['workYear'],\n",
    "                    'salary': item['salary'],\n",
    "                    'firstType': item['firstType'],\n",
    "                    'secondType': item['secondType'],\n",
    "                    'thirdType': item['thirdType'],\n",
    "                    'skillLables': item['skillLables']\n",
    "                }\n",
    "                data.append(dict)\n",
    "        return data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 245,
   "metadata": {},
   "outputs": [],
   "source": [
    "data = get_data()\n",
    "data = pd.DataFrame(data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 246,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"f542ab50238b40ee868439c190953a80\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_f542ab50238b40ee868439c190953a80 = echarts.init(\n",
       "                    document.getElementById('f542ab50238b40ee868439c190953a80'), 'white', {renderer: 'canvas'});\n",
       "                var option_f542ab50238b40ee868439c190953a80 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"data\": [\n",
       "                6,\n",
       "                5,\n",
       "                4,\n",
       "                4,\n",
       "                4,\n",
       "                3,\n",
       "                3,\n",
       "                2,\n",
       "                2,\n",
       "                2,\n",
       "                2,\n",
       "                2,\n",
       "                2,\n",
       "                2,\n",
       "                2,\n",
       "                1,\n",
       "                1,\n",
       "                1,\n",
       "                1,\n",
       "                1\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"name\": \"\\u85aa\\u8d44\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"nameRotate\": 0,\n",
       "            \"gridIndex\": 0,\n",
       "            \"axisLabel\": {\n",
       "                \"rotate\": 45\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"4k-8k\",\n",
       "                \"4k-6k\",\n",
       "                \"8k-15k\",\n",
       "                \"6k-10k\",\n",
       "                \"5k-8k\",\n",
       "                \"2k-3k\",\n",
       "                \"8k-16k\",\n",
       "                \"5k-10k\",\n",
       "                \"10k-15k\",\n",
       "                \"6k-9k\",\n",
       "                \"20k-40k\",\n",
       "                \"14k-24k\",\n",
       "                \"6k-8k\",\n",
       "                \"10k-20k\",\n",
       "                \"15k-25k\",\n",
       "                \"24k-48k\",\n",
       "                \"6k-11k\",\n",
       "                \"6k-12k\",\n",
       "                \"15k-20k\",\n",
       "                \"7k-10k\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {}\n",
       "    ]\n",
       "};\n",
       "                chart_f542ab50238b40ee868439c190953a80.setOption(option_f542ab50238b40ee868439c190953a80);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1ba7935e668>"
      ]
     },
     "execution_count": 246,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "salary_value_counts = data['salary'].value_counts()\n",
    "salary = list(salary_value_counts.head(top).index)\n",
    "salary_counts = list(salary_value_counts.head(top))\n",
    "\n",
    "bar = (\n",
    "    Bar()\n",
    "        .add_xaxis(salary)\n",
    "        .add_yaxis(\"\", salary_counts)\n",
    "        .set_global_opts(xaxis_opts=opts.AxisOpts(name_rotate=0, name=\"薪资\", axislabel_opts={\"rotate\": 45}))\n",
    ")\n",
    "bar.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 分析上列图表可以看出：\n",
    "- **传统行业的文案工作薪资范围大概稳定在6k-10k 网新相关行业则没有稳定范围 值得关注的是人工智能与企业服务这两个行业 薪资水平均属于比较高的范围 撰写产品文档也许是文案工作发展的新方向**"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 相关链接及尝试过程中参考文章分享\n",
    "1.[拉勾网首页](https://www.lagou.com/)\n",
    "\n",
    "2.[本文档基础框架参考github仓库](https://github.com/JustDoPython/python-examples/tree/master/doudou/2020-07-13-lagou)\n",
    "\n",
    "3.[python请求https出现443错误的解决办法](https://blog.csdn.net/qq_42959350/article/details/90692950)\n",
    "\n",
    "4.[编码方式gbk出现错误解决方法](https://blog.csdn.net/BohnLee/article/details/79889744)\n",
    "\n",
    "5.[阻止安全警告弹出方法](https://www.cnblogs.com/zrmw/p/9869210.html)\n",
    "\n",
    "6.[requests语法参考文档](https://requests-html.kennethreitz.org/)\n",
    "\n",
    "7.[尝试过的scrapy框架爬取文章](https://blog.csdn.net/qq_36523839/article/details/80583827)\n",
    "\n",
    "8.[无法成功导出xlsx的原因解释](https://blog.csdn.net/kisswife/article/details/76595876?utm_source=blogxgwz3)\n",
    "\n",
    "9.[如何将xlsx及csv文件导入jupyter](https://blog.csdn.net/skn000/article/details/104603279/)\n",
    "\n",
    "10.[尝试过的将txt文件转换为xlsx格式文章](https://zhidao.baidu.com/question/1574263622761667140.html)\n",
    "\n",
    "11.[尝试过的scrapy爬取智联招聘网方法](https://www.cnblogs.com/nmsghgnv/p/11348448.html)\n",
    "\n",
    "12.[尝试过的scrapy导出数据为空解决方法](https://bbs.csdn.net/topics/392401129)\n",
    "\n",
    "13.[尝试过的values中的list长度不一致报错原因](https://www.e-learn.cn/content/python/2658069)\n",
    "\n",
    "14.[尝试过的scrapy爬取直聘网方法](https://blog.csdn.net/jesseakylin/article/details/96630211)\n",
    "\n",
    "15.[尝试过的No connection adapters报错解决方法](https://www.v2ex.com/t/502370)\n",
    "\n",
    "16.[尝试过的MySQL远程连接的时候报错1130解决方法](https://www.cnblogs.com/gmblog/p/3826330.html)\n",
    "\n",
    "17.[尝试过的scrapy爬取58同城招聘信息文章](https://blog.csdn.net/cy2cn/article/details/106497343)\n",
    "\n",
    "18.[尝试过的scrapy爬取三个招聘网站的gitee仓库](https://gitee.com/SGY_0519/Scrapy_Recruit)\n",
    "\n",
    "19.[尝试过的scrapy爬取腾讯招聘信息的文章（腾讯招聘已限制爬取）](https://blog.csdn.net/liangmengbk/article/details/107136707)\n",
    "\n",
    "20.[scrapy框架内item文件的参数介绍](https://blog.csdn.net/area_52/article/details/46045115)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 感谢你的浏览 辛苦了(๑╹◡╹)ﾉ\"\"\" "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
